Skip to content

Conversation

@pictos
Copy link
Member

@pictos pictos commented Oct 28, 2025

Description of Change

Removed the NavigationBar and make sure the Close will work. When you open a Popup inside a ModalPage the Popup will not show on ModalStack, what shows up is a NavigationPage and the PopupPage will be its Content.

Linked Issues

PR Checklist

  • Has a linked Issue, and the Issue has been approved(bug) or Championed (feature/proposal)
  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pulls

Additional information

Copilot AI review requested due to automatic review settings October 28, 2025 03:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses an issue where popups opened inside modal pages fail to display correctly due to navigation bar interference. The fix removes the navigation bar from popup pages and implements proper modal stack traversal to locate and close popups that are wrapped in navigation containers.

Key Changes:

  • Explicitly disables the navigation bar for popup pages to prevent UI conflicts
  • Adds a FindPopupPage() method to handle closing popups that are nested within page containers (e.g., NavigationPage)
  • Removes unused imports to clean up the code

@pictos pictos force-pushed the pj/fix-modal-on-popups branch from f69560f to d70a248 Compare October 31, 2025 03:15
Copy link
Collaborator

@TheCodeTraveler TheCodeTraveler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Pedro! Could you add some UnitTests before we merge this?

@nikamvd
Copy link

nikamvd commented Nov 5, 2025

@pictos Is there any way to apply this fix while using the current CommunityToolkit.Maui version 12.3.0 until this fix gets released in a newer version? My project heavily relies on showing modal pages wrapped inside navigation pages, which I can't change at this moment due to the amount of refactoring that will be needed.

@nikamvd nikamvd mentioned this pull request Nov 5, 2025
2 tasks
@TheCodeTraveler TheCodeTraveler changed the title Make peace between modal navigation and popups (Popup) Enable Popup v2 Inside Custom NavigationPage Nov 5, 2025
TheCodeTraveler
TheCodeTraveler previously approved these changes Nov 5, 2025
Copy link
Collaborator

@TheCodeTraveler TheCodeTraveler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Pedro!

I added a reproduction to the Sample app along with some Unit Tests 🙌

@TheCodeTraveler TheCodeTraveler merged commit d49bbd7 into main Nov 6, 2025
11 checks passed
@TheCodeTraveler TheCodeTraveler deleted the pj/fix-modal-on-popups branch November 6, 2025 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Popup V2 within NavigationPage

4 participants